<?php
    /**
     +=========================================================
     * 关于 , 个人简历类
     * @package Resume (早期零度空间个人简历)
     +=========================================================
     * @copyright © 2011 nickdraw.com All rights reserved.
     * @author NickDraw(零度温柔) webmaster@206c.net
     * @license http://www.nickdraw.com/license
     * @version V1.2
     +=========================================================
     */
    class ResumeAction extends CommonAction {
        
        public function index(){
            
            if (!isset($_GET['type'])) {
                $type = 'myinfo'; 
            }else{
                $type = $_GET['type'];
            }
            
            $type_model = M('resume_type');
            $type_list = $type_model->order('sort')->select();
            
            $resume_model = M('resume');
            $resume_list = $resume_model->where("type='{$type}'")->select();
            
            $this->assign("type_list",$type_list);
            $this->assign("resume_list",$resume_list);
            $this->assign("type",$type);
            
            $this->display();
        }
        
        public function add(){
            $this->display("add_".$_GET['type']);
        }
        
        public function insert(){
            $m = D("resume");
            if ($m->add($_POST)){
                $this->assign("jumpUrl", Cookie::get ( '_currentUrl_' ) );
                $this->success('添加完成');
            }else{
                $this->error("添加失败");
            }
        }
    }
    
?>